package consultan.vanke.com.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.constraintlayout.widget.ConstraintLayout;

import butterknife.BindView;
import butterknife.OnClick;
import consultan.vanke.com.R;
import consultan.vanke.com.utils.CircleImageView;
import consultan.vanke.com.utils.SimpleToolbar;
import qiu.niorgai.StatusBarCompat;

import static com.bytedance.sdk.account.open.aweme.utils.ViewUtils.getStatusBarHeight;
import static consultan.vanke.com.utils.StatusBarUtil.setRootView;

public class MinePagerFrg extends BaseFragment {

    @BindView(R.id.simple_toolbar)
    SimpleToolbar simpleToolbar;
    @BindView(R.id.simple_toolbar_main)
    ConstraintLayout simpleToolbarMain;
    @BindView(R.id.img_head)
    CircleImageView imgHead;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_id)
    TextView tvId;
    @BindView(R.id.tv_text)
    TextView tvText;
    @BindView(R.id.linear_left)
    LinearLayout linearLeft;
    @BindView(R.id.rel_item1)
    RelativeLayout relItem1;
    @BindView(R.id.linear_right)
    LinearLayout linearRight;
    @BindView(R.id.rel_item2)
    RelativeLayout relItem2;
    @BindView(R.id.rel_item3)
    RelativeLayout relItem3;
    @BindView(R.id.rel_item4)
    RelativeLayout relItem4;
    @BindView(R.id.img_settting)
    ImageView imgSettting;
    @BindView(R.id.rel_item5)
    RelativeLayout relItem5;
    @BindView(R.id.rel_item6)
    RelativeLayout relItem6;
    @BindView(R.id.tv_vip)
    TextView tvVip;

    @Override
    protected void initVariable() {
        super.initVariable();
    }

    @Override
    protected void initViews() {
        simpleToolbar.setLeftImageGone();
    }

    @Override
    protected void initDatas() {
    }


    @Override
    protected void initEvents() {

    }


    @Override
    protected View initContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = View.inflate(_mActivity, R.layout.mine_fragment, null);
        return rootView;
    }

    @Override
    public void onSupportVisible() {
        super.onSupportVisible();
        ViewGroup decorView = (ViewGroup) _mActivity.getWindow().getDecorView();
        View fakeStatusBarView = new View(_mActivity);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(_mActivity) + 3);
        fakeStatusBarView.setLayoutParams(params);
        fakeStatusBarView.setBackground(getResources().getDrawable(R.drawable.fast_regist_title_bg));
        fakeStatusBarView.setId(android.R.id.custom);
        decorView.addView(fakeStatusBarView);
        setRootView(_mActivity, false);
        StatusBarCompat.translucentStatusBar(_mActivity, true);
    }

    @OnClick({R.id.img_head, R.id.linear_left, R.id.rel_item1, R.id.linear_right, R.id.rel_item2, R.id.rel_item3, R.id.rel_item4, R.id.img_settting, R.id.rel_item5, R.id.rel_item6, R.id.tv_vip})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.img_head:
                startBrotherFragment(new MyCenterFragment());
                break;
            case R.id.linear_left:
                startBrotherFragment(new MyMoneyFragment());
                break;
            case R.id.rel_item1:
                startBrotherFragment(new MyBaoFragment());
                break;
            case R.id.linear_right:
                startBrotherFragment(new MyJFFragment());
                break;
            case R.id.rel_item2:
                startBrotherFragment(new MyGZFragment());
                break;
            case R.id.rel_item3:
                startBrotherFragment(new MySCFragment());
                break;
            case R.id.rel_item4:
                startBrotherFragment(new MyZJFragment());
                break;
            case R.id.img_settting:
                startBrotherFragment(new MySzFragment());
                break;
            case R.id.rel_item5:
                startBrotherFragment(new MyDdFragment());
                break;
            case R.id.rel_item6:
                startBrotherFragment(new PingjiaFragment());
                break;
            case R.id.tv_vip:
                startBrotherFragment(new VipFragment());
                break;
        }
    }
}
